<%-- 
    Document   : register
    Created on : Jul 1, 2011, 10:02:28 AM
    Author     : PhongLK60473
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    <style type="" >
div.label{
    text-transform: capitalize;
    font-weight: bold;
    font-size:11pt;
}
#register-pnl{
    width:300px;
    border:2px solid #00cc66;
    margin:0 auto;
    padding:10px;
}
#register-pnl-title{
    margin:-10px;
    margin-bottom: 20px;
    background-color: #ccffcc;
    color: #339900;
    text-align: center;
    padding:5px;
    font-size:15pt;
}


        </style>
    </head>
    <body>
        <div id="register-pnl">
            <div id="register-pnl-title">REGISTER</div>
            <form action="UserController" method="POST">
            <div id="register-pnl-content">
                <div class="line center">

                </div>
                <div class="line">
                    <div class="label">Username : </div>
                    <input type="text" name="txtUsername" size="20" id="u">
                </div>
                <div class="line">
                    <div class="label">Password : </div>
                    <input type="password" name="txtPassword" size="20" id="p1">
                </div>
                <div class="line">
                    <div class="label">Lastname : </div>
                    <input type="password" name="txtLastname" size="20" id="p2">
                </div>
                <div class="line">
                    <div class="label">Fulltime : </div>
                    <input type="checkbox" name="chkAdmin" size="20" id="p2">
                </div>
                <div class="line center">
                    <input type="submit" value="Register" name="action"/>
                </div>
                
            </div>
                <script>
                    document.onsubmit=function(){
                        if(document.getElementById("u").value.trim()==""){
                            document.getElementById("error").innerHTML="Username can not leave blank";
                            document.getElementById("u").focus()
                            return false;
                        } else if(document.getElementById("p1").value.trim()==""){
                            document.getElementById("error").innerHTML="Password can not leave blank";
                            document.getElementById("p1").focus()
                            return false;
                        } else if(document.getElementById("p1").value==document.getElementById("p2").value){
                            return true;
                        } else {
                            document.getElementById("error").innerHTML="Password not match!";
                            document.getElementById("p1").value="";
                            document.getElementById("p2").value="";
                            document.getElementById("p1").focus()
                            return false;
                        }
                    }
                </script>
            </form>
        </div>
    </body>
</html>
